<?php
class SysbakAction extends BaseAction
{
	function index()
	{
		$this->display();

	}
	
	function clearCache()
	{
		import("ORG.Io.Dir");
		
		Dir::del(APP_PATH."/Temp/");
		Dir::del(APP_PATH."/Cache/");
		Dir::del(APP_PATH."/Data/");
		
		Dir::del("./Web/Temp/");
		Dir::del("./Web/Cache/");
		Dir::del("./Web/Data/");
		
		$this->success('清空成功!');
		
	}


	function bakup(){
		$tableName  = 'article'; 
		$backupFile = './Public/file/mypet.sql'; 
		$query      = "SELECT * INTO OUTFILE '$backupFile' FROM $tableName"; 
		$model = new Model();
		$result =  $model->query($query);
		
		dump($result);
	}
	
	
	function bakup2(){
	
		set_time_limit(600); 
		  
        system("mysqldump --opt -h localhost -u root -p   qhcms | gzip >./Public/file/database.sql");   
        //exec("gzip   database.sql"); 
		
		
	}

}
?>